package com.example;

/**
 * @since ClassLoader
 */
public class TestClassLoader {
    public static void main(String[] args) {
        //系统类加载器 自定义的类
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);
        
        //拓展类加载器 jre/lib/ext下的jar
        ClassLoader extendClassLoader = systemClassLoader.getParent();
        System.out.println(extendClassLoader);
        
        //引导类加载器 核心类库 是不能得到的
        System.out.println(extendClassLoader.getParent());
        
        Class clazz = TestClassLoader.class;
        System.out.println(clazz.getClassLoader());
        
        clazz = String.class;
        System.out.println(clazz.getClassLoader());
        
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        System.out.println(contextClassLoader);
    }
}





